package cn.tedu.car.user.controller;

import cn.tedu.car.base.response.JsonResult;
import cn.tedu.car.user.pojo.dto.UserLoginParam;
import cn.tedu.car.user.pojo.vo.UserVO;
import cn.tedu.car.user.service.UserService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "用户模块")
@Slf4j
@RestController
@RequestMapping("/v1/user")
public class UserController {
@Autowired
UserService userService;
@Operation(summary = "用户登录")
@ApiOperationSupport(order = 10)
@PostMapping("/login")
    public JsonResult login(UserLoginParam userLoginParam ){
    log.debug("用户登录：userLoginParam{}",userLoginParam);
    UserVO userVO = userService.login(userLoginParam);
    return JsonResult.ok(userVO);
}

}
